import {createId} from "../../../util/common";

export class TagEntity {
    id: string
    value: string

    constructor(id?: string, value?: string) {
        this.id = id;
        this.value = value;
    }

    static of({id, value}) {
        const tagEntity = new TagEntity();
        if (id) {
            tagEntity.id = id
        } else {
            tagEntity.id = createId()
        }
        tagEntity.value = value
        return tagEntity;
    }
}

